package org.example.springmessage;

import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

public class test {
    @Test
    public void test() throws IOException {
        Path filePath = Paths.get("src/main/resources/static/photo/"+"1");
        // 确保目标文件夹存在
        Files.createDirectories(filePath.getParent());
        String fileName = "test.txt";
        // 将文件保存到目标路径
        Files.write(filePath, fileName.getBytes());
    }
}
